<%@ page language="java" pageEncoding="UTF-8"%>
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" />
<script src="js/jquery-3.2.1.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<script src="layer/layer.js"></script>
<style>
nav {
	/* 		background-color:#487eb0 !important;  */
	/* 		border-color:#487eb0 !important;  */
	border-radius: 0 !important;
}
</style>
<nav class="navbar navbar-inverse">
	<div class="container">
		<a href="" class="navbar-brand">软帝资源共享系统</a>
		<ul class="nav navbar-nav navbar-right">
			<li><a href="doList.jsp">资源列表</a></li>
			<li><a href="upload.jsp">上传资源</a></li>
			<li><a href="doMyList.jsp">我的上传</a></li>
			<li><a href="doMyDownload.jsp">我的下载</a></li>
			<li><a href="#" class="dropdown-toggle" data-toggle="dropdown">${sessionScope.user.username} <span class="caret"></span></a>
				<ul class="dropdown-menu">
					<li><a href="#">修改密码</a></li>
					<li role="separator" class="divider"></li>
					<li><a href="javascript:void(0)" id="logout">安全退出 </a></li>
				</ul>
			</li>
		</ul>
	</div>
</nav>
<script>
	$(function(){
		//为所有列表项绑定点击事件
		$('.nav>li').on('click',function(){
			//移除所有li上的active 类
			$('.nav>li').removeClass('active');
			//为被点击的li元素添加active类
			$(this).addClass('active');
		})
		
		$('#logout').on('click',function(){
			layer.confirm('确认退出?',{
				btn:['确认','取消']	
			},function(){
				//确认
				location.href='doLogout.jsp'
			},function(){
				//取消(该函数可省略)
			});
		})
	})
</script>